<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <div class="demo">
      <div class="box">
        <span class="child">span元素</span>
      </div>
    </div>
    <script>
      var child = document.querySelector('.child');
      console.log(child.parentNode); 
    </script>
  </body>
</html>